<!DOCTYPE html>
<html>

<head xmlns:th="http://www.thymeleaf.org">
    <meta charset="UTF-8">
    <title>首页</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="../../static/js/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="../../static/js/jquery-3.3.1.min.js"></script>
    <link rel="stylesheet" href="../../static/css/index.css">
    <style>
        .header-div {
            display: flex;
            margin-right: 20px;
            float: right;
        }

        .header-div>div {
            margin-right: 20px;
        }

        .el-header {
            padding: 0;
        }

        .menu-span-red {
            color: red;
        }
    </style>
</head>

<body>
    <div id="app">
        <el-container class="container-1">
            <el-header>
                <div class="header-div">
                    <div>用户：{{username}}</div>
                    <div>职位：{{duty}}</div>
                    <div>
                        <el-button type="text" @click="tologin">退出登录</el-button>
                    </div>
                </div>
            </el-header>
            <el-container class="container-1-1">
                <el-aside width="220px">
                    <el-menu style="border-right: 0">
                        <el-submenu index="1">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">订单管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="1-1" @click="open('../orders/add_orders.html')">新建订单</el-menu-item>
                                <el-menu-item index="1-2"
                                    @click="open('../orders/orders_check_pending.html')">查看订单(<span
                                        class="menu-span-red">未审批</span>)</el-menu-item>
                                <el-menu-item index="1-3" @click="open('../orders/orders_audited.html')">查看订单(<span
                                        class="menu-span-red">已审批</span>)</el-menu-item>
                                <el-menu-item index="1-4" @click="open('../orders/orders_completed.html')">查看订单(<span
                                        class="menu-span-red">已完成</span>)</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="2">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">客户管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="2-1" @click="open('../client/add_client.html')">添加客户</el-menu-item>
                                <el-menu-item index="2-2"
                                    @click="open('../client/select_client.html')">查看客户</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="3">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">销售统计</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="3-1" @click="open('../salesStatistics/part_statistics.html')">零件统计
                                </el-menu-item>
                                <el-menu-item index="3-2"
                                    @click="open('../salesStatistics/purchase_order_statistics.html')">订购单统计
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="4">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">密码修改</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="4-1"
                                    @click="open('../deptfunds/deptfunds.html')">密码修改</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="5">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">采购管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="5-1" @click="open('../buy/warehouse_buy.html')">查看仓管申请
                                </el-menu-item>
                                <el-menu-item index="5-2"
                                    @click="open('../buy/not_passed.html')">查看所有未通过采购</el-menu-item>
                                <el-menu-item index="5-3"
                                    @click="open('../buy/procurement_arrival_situation.html')">查看采购到货情况
                                </el-menu-item>
                                <el-menu-item index="5-4"
                                    @click="open('../buy/procurement_statistics.html')">采购统计</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="6">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">雇员管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="6-1" @click="open('../receiveApply/SaveEmployeetable.html')">
                                    添加雇员信息
                                </el-menu-item>
                                <el-menu-item index="6-2" @click="open('../receiveApply/Employeetable.html')">查看雇员信息
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="7">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">普通管理员管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="7-1"
                                    @click="open('../receiveApply/generalAdministrator.html')">查看普通管理员
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="8">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">系统参数管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="8-1"
                                    @click="open('../system_parameter_management/view_system_parameters.html')">显示系统参数
                                </el-menu-item>
                                <el-menu-item index="8-2"
                                    @click="open('../system_parameter_management/add_system_parameters.html')">添加系统参数
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="9">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">打印管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="9-1" @click="open('../print_management/client.html')">打印客户信息
                                </el-menu-item>
                                <el-menu-item index="9-2" @click="open('../print_management/sales_message.html')">打印销售信息
                                </el-menu-item>
                                <el-menu-item index="9-3" @click="open('../print_management/inventory.html')">打印库存信息
                                </el-menu-item>
                                <el-menu-item index="9-4" @click="open('../print_management/purchase.html')">打印采购信息
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="10">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">采购计划管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="10-1" @click="open('../purchase_plan/approve_purchase.html')">
                                    审批采购计划
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="11">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">仓库管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="11-1"
                                    @click="open('../warehouseManagement/outstoretable.html')">查看出库信息
                                </el-menu-item>
                                <el-menu-item index="11-2" @click="open('../warehouseManagement/inStoreTable.html')">查看入库信息
                                </el-menu-item>
                                <el-menu-item index="11-3" @click="open('../warehouseManagement/car.html')">查看所有库存信息
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                    </el-menu>
                </el-aside>
                <el-main>
                    <iframe :src="iframeSrc"></iframe>
                </el-main>
            </el-container>
        </el-container>
    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            iframeSrc: "",
            username: localStorage.getItem("username"),
            duty: localStorage.getItem("duty")
        }, methods: {
            open(src) {
                this.iframeSrc = src;
            },
            tologin() {
                localStorage.clear();
                window.location.href = "../login/login.html";
            }
        }
    })
</script>

</html>